$input v_position

#include "../../bgfx/examples/common/common.sh"

uniform vec4 u_depthScaleOffset;  // for opengl, from [-1,1] to [0, 1] range   x:depthScaleOffset  y:u_depthOffset

void main()
{
	float depth = v_position.z/v_position.w * u_depthScaleOffset.y + u_depthScaleOffset.x;
	gl_FragColor = packFloatToRgba(depth);
}